package com.JavaWk2_9;

public class t9 {
    public static void main(String[] args) {
        Tv t = new Tv("X","US",100,"perfect",1);
        Tv.Output(t);
        Tv.up(); //加声音
        Tv.Output(t);
        t.turnChannel(10); //换频道
        t.turnOption(); //开关电视
        Tv.Output(t);
    }

}
class Tv {
    private int t_Id;
    private String t_Model, t_Factor, t_Quality;
    private int t_Size, t_Channel;
    private boolean t_Option;
    private static int t_Volume = 0;
    private static int autoID = 0;

    public Tv(){}

    public Tv(String m, String f, int s, String q, int c){
        this.t_Id = autoID ++ ;
        this.t_Model = m;
        this.t_Factor = f;
        this.t_Size = s;
        this.t_Quality = q;
        this.t_Option = false;
        this.t_Channel = c;
    }
    public void turnOption(){
        this.t_Option = !this.t_Option;
    }
    public void turnChannel(int n) {
        this.t_Channel = n;
    }
    public String getSwitchState(){
        if(this.t_Option) {
            return "ON";
        }
        else{
            return "OFF";
        }
    }

    public static void up() {
        t_Volume += 2;
    }
    public static void down() {
        t_Volume -= 2;
    }
    public static void Output(Tv t) {
        System.out.print("Num：" + t.t_Id);
        System.out.print(" Model：" + t.t_Model);
        System.out.print(" Factor：" + t.t_Factor);
        System.out.print(" Size：" + t.t_Size);
        System.out.print(" Quality：" + t.t_Quality);
        System.out.print(" Option：" + t.getSwitchState());
        System.out.print(" Vol：" + t.t_Volume);
        System.out.println(" Channel：" + t.t_Channel);
    }

}
